using UnityEngine;

namespace Crosstales.Common.Util
{
    // [Assembly-CSharp-firstpass.dll].Crosstales.Common.Util.CTPlayerPrefs
    public abstract class CTPlayerPrefs
    {
        // Methods
        public static bool HasKey(string key)
        {
            if((System.String.IsNullOrEmpty(value:  key)) == false)
            {
                    return UnityEngine.PlayerPrefs.HasKey(key:  key);
            }
            
            return false;
        }
        public static void DeleteAll()
        {
            UnityEngine.PlayerPrefs.DeleteAll();
        }
        public static void DeleteKey(string key)
        {
            if((System.String.IsNullOrEmpty(value:  key)) != true)
            {
                    UnityEngine.PlayerPrefs.DeleteKey(key:  key);
                return;
            }
            
            27342272 = new System.ArgumentNullException(paramName:  27538584);
            throw 27342272;
        }
        public static void Save()
        {
            UnityEngine.PlayerPrefs.Save();
        }
        public static string GetString(string key)
        {
            if((System.String.IsNullOrEmpty(value:  key)) != true)
            {
                    return UnityEngine.PlayerPrefs.GetString(key:  key);
            }
            
            27342272 = new System.ArgumentNullException(paramName:  27538584);
            throw 27342272;
        }
        public static float GetFloat(string key)
        {
            if((System.String.IsNullOrEmpty(value:  key)) != true)
            {
                    return UnityEngine.PlayerPrefs.GetFloat(key:  key);
            }
            
            27342272 = new System.ArgumentNullException(paramName:  27538584);
            throw 27342272;
        }
        public static int GetInt(string key)
        {
            if((System.String.IsNullOrEmpty(value:  key)) != true)
            {
                    return UnityEngine.PlayerPrefs.GetInt(key:  key);
            }
            
            27342272 = new System.ArgumentNullException(paramName:  27538584);
            throw 27342272;
        }
        public static bool GetBool(string key)
        {
            if(mem[536886147] != 0)
            {
                    return Crosstales.ExtensionMethods.CTEquals(str:  -1610595601, toCheck:  Crosstales.Common.Util.CTPlayerPrefs.GetString(key:  key), comp:  5);
            }
            
            return Crosstales.ExtensionMethods.CTEquals(str:  -1610595601, toCheck:  Crosstales.Common.Util.CTPlayerPrefs.GetString(key:  key), comp:  5);
        }
        public static System.DateTime GetDate(string key)
        {
            bool val_2 = System.DateTime.TryParseExact(s:  Crosstales.Common.Util.CTPlayerPrefs.GetString(key:  key), format:  -1610594857, provider:  0, style:  0, result:  new System.DateTime() {_dateData = 323571016});
            return 0;
        }
        public static UnityEngine.Vector2 GetVector2(string key)
        {
            Unknown val_2 = Crosstales.Common.Util.CTPlayerPrefs.GetString(key:  key).Split(separator:  ';', options:  0);
            if(val_2.Length != 0)
            {
                    float val_3 = System.Single.Parse(s:  val_2[0]);
                if(val_2.Length > 1)
            {
                    string val_6 = val_2[1];
                float val_4 = System.Single.Parse(s:  val_6);
                return (UnityEngine.Vector2)val_6;
            }
            
            }
        
        }
        public static UnityEngine.Vector3 GetVector3(string key)
        {
            Unknown val_2 = Crosstales.Common.Util.CTPlayerPrefs.GetString(key:  key).Split(separator:  ';', options:  0);
            if(val_2.Length == 0)
            {
                    throw new NullReferenceException();
            }
            
            if(val_2.Length <= 1)
            {
                    throw new NullReferenceException();
            }
            
            if(val_2.Length <= 2)
            {
                    throw new NullReferenceException();
            }
            
            return new UnityEngine.Vector3() {x = System.Single.Parse(s:  val_2[0]), y = System.Single.Parse(s:  val_2[1]), z = System.Single.Parse(s:  val_2[2])};
        }
        public static UnityEngine.Vector4 GetVector4(string key)
        {
            Unknown val_2 = Crosstales.Common.Util.CTPlayerPrefs.GetString(key:  key).Split(separator:  ';', options:  0);
            if(val_2.Length == 0)
            {
                    throw new NullReferenceException();
            }
            
            if(val_2.Length <= 1)
            {
                    throw new NullReferenceException();
            }
            
            if(val_2.Length <= 2)
            {
                    throw new NullReferenceException();
            }
            
            if(val_2.Length <= 3)
            {
                    throw new NullReferenceException();
            }
            
            return new UnityEngine.Vector4() {x = System.Single.Parse(s:  val_2[0]), y = System.Single.Parse(s:  val_2[1]), z = System.Single.Parse(s:  val_2[2]), w = System.Single.Parse(s:  val_2[3])};
        }
        public static UnityEngine.Quaternion GetQuaternion(string key)
        {
            UnityEngine.Vector4 val_1 = Crosstales.Common.Util.CTPlayerPrefs.GetVector4(key:  key);
            if(mem[536886147] != 0)
            {
                    return Crosstales.ExtensionMethods.CTQuaternion(angle:  new UnityEngine.Vector4() {x = val_1.x, y = val_1.y, z = val_1.z, w = val_1.w});
            }
            
            return Crosstales.ExtensionMethods.CTQuaternion(angle:  new UnityEngine.Vector4() {x = val_1.x, y = val_1.y, z = val_1.z, w = val_1.w});
        }
        public static UnityEngine.Color GetColor(string key)
        {
            UnityEngine.Vector4 val_1 = Crosstales.Common.Util.CTPlayerPrefs.GetVector4(key:  key);
            if(mem[536886147] != 0)
            {
                    return Crosstales.ExtensionMethods.CTColorRGBA(rgba:  new UnityEngine.Vector4() {x = val_1.x, y = val_1.y, z = val_1.z, w = val_1.w});
            }
            
            return Crosstales.ExtensionMethods.CTColorRGBA(rgba:  new UnityEngine.Vector4() {x = val_1.x, y = val_1.y, z = val_1.z, w = val_1.w});
        }
        public static UnityEngine.SystemLanguage GetLanguage(string key)
        {
            object val_3 = System.Enum.Parse(enumType:  System.Type.GetTypeFromHandle(handle:  new System.RuntimeTypeHandle() {value = 1073764335}), value:  Crosstales.Common.Util.CTPlayerPrefs.GetString(key:  key));
            return (UnityEngine.SystemLanguage)null;
        }
        public static void SetString(string key, string value)
        {
            if((System.String.IsNullOrEmpty(value:  key)) != true)
            {
                    UnityEngine.PlayerPrefs.SetString(key:  key, value:  value);
                return;
            }
            
            27342272 = new System.ArgumentNullException(paramName:  27538584);
            throw 27342272;
        }
        public static void SetFloat(string key, float value)
        {
            if((System.String.IsNullOrEmpty(value:  key)) != true)
            {
                    UnityEngine.PlayerPrefs.SetFloat(key:  key, value:  value);
                return;
            }
            
            27342272 = new System.ArgumentNullException(paramName:  27538584);
            throw 27342272;
        }
        public static void SetInt(string key, int value)
        {
            if((System.String.IsNullOrEmpty(value:  key)) != true)
            {
                    UnityEngine.PlayerPrefs.SetInt(key:  key, value:  value);
                return;
            }
            
            27342272 = new System.ArgumentNullException(paramName:  27538584);
            throw 27342272;
        }
        public static void SetBool(string key, bool value)
        {
            Crosstales.Common.Util.CTPlayerPrefs.SetString(key:  key, value:  (value != true) ? 27546816 : 27534304);
        }
        public static void SetDate(string key, System.DateTime value)
        {
            Crosstales.Common.Util.CTPlayerPrefs.SetString(key:  key, value:  value._dateData.ToString(format:  -1610594857));
        }
        public static void SetVector2(string key, UnityEngine.Vector2 value)
        {
            Crosstales.Common.Util.CTPlayerPrefs.SetString(key:  key, value:  System.String.Format(format:  -1610594671, arg0:  536892547, arg1:  536892547));
        }
        public static void SetVector3(string key, UnityEngine.Vector3 value)
        {
            Crosstales.Common.Util.CTPlayerPrefs.SetString(key:  key, value:  System.String.Format(format:  -1610594669, arg0:  536892547, arg1:  536892547, arg2:  536892547));
        }
        public static void SetVector4(string key, UnityEngine.Vector4 value)
        {
            if(mem[536881369] == 0)
            {
                    throw new ArrayTypeMismatchException();
            }
            
            mem[536881377] = 536892547;
            if(mem[536881369] <= 1)
            {
                    throw new ArrayTypeMismatchException();
            }
            
            mem[536881385] = 536892547;
            if(mem[536881369] <= 2)
            {
                    throw new ArrayTypeMismatchException();
            }
            
            mem[536881393] = 536892547;
            if(mem[536881369] <= 3)
            {
                    throw new ArrayTypeMismatchException();
            }
            
            mem[536881401] = 536892547;
            Crosstales.Common.Util.CTPlayerPrefs.SetString(key:  key, value:  System.String.Format(format:  -1610594667, args:  536881345));
        }
        public static void SetQuaternion(string key, UnityEngine.Quaternion value)
        {
            UnityEngine.Vector4 val_1 = Crosstales.ExtensionMethods.CTVector4(angle:  new UnityEngine.Quaternion() {x = value.x, y = value.y, z = value.z, w = value.w});
            Crosstales.Common.Util.CTPlayerPrefs.SetVector4(key:  key, value:  new UnityEngine.Vector4() {x = val_1.x, y = val_1.y, z = val_1.z, w = val_1.w});
        }
        public static void SetColor(string key, UnityEngine.Color value)
        {
            UnityEngine.Vector4 val_1 = Crosstales.ExtensionMethods.CTVector4(color:  new UnityEngine.Color() {r = value.r, g = value.g, b = value.b, a = value.a});
            Crosstales.Common.Util.CTPlayerPrefs.SetVector4(key:  key, value:  new UnityEngine.Vector4() {x = val_1.x, y = val_1.y, z = val_1.z, w = val_1.w});
        }
        public static void SetLanguage(string key, UnityEngine.SystemLanguage language)
        {
            Crosstales.Common.Util.CTPlayerPrefs.SetString(key:  key, value:  536893423.ToString());
        }
        protected CTPlayerPrefs()
        {
        
        }
    
    }

}
